return new Promise((resolve, reject) => {
    /*
    let jsonPath = MixlyUrl?.BOARD_CONFIG?.hardware?.json ?? null;
    let packagePath = MixlyUrl?.BOARD_CONFIG?.hardware?.package ?? null;
    if (typeof jsonPath !== "string" || typeof packagePath !== "string")
        reject();
    fsPro.del
    fsPro.cpdir(path, MixlyArduino.arduinoCliPath + "/Arduino15/").then((message) => {
        return fsPro.deldir(path);
    }).then((message) => {
        resolve();
    }).catch((e) => {
        reject(e);
    })
    */
    /* fsPro.readdir(path).then((message) => {
        let cpDirArr = [];
        let cpFileArr = [];
        let delDirArr = [];
        let mkDirArr = [];
        let len = message.length;
        for (let i = 0; i < len; i++) {
            let oldPath = path + "/" + message[i];
            let stat = nodeFs.statSync(oldPath);
            if (stat.isFile()) {
                let newPath = MixlyArduino.arduinoCliPath + "/Arduino15/" + message[i];
                cpFileArr.push([oldPath, newPath]);
            } else {
                let newPath = MixlyArduino.arduinoCliPath + "/Arduino15/packages/" + message[i];
                cpDirArr.push([oldPath, newPath]);
                if (nodeFs.existsSync(newPath)
                    && nodeFs.statSync(newPath).isDirectory()) {
                    delDirArr.push(newPath);
                    mkDirArr.push(newPath);
                }
            }
        }
        let delDirProArr = [];
        for (let i = 0; i < delDirArr.length; i++) {
            delDirProArr.push(fsPro.deldir(delDirArr[i]));
        }
        Promise.all(delDirProArr).then(message => {

        }).catch(e => {

        }).finally(() => {
            let mkDirProArr = [];
            for (let i = 0; i < mkDirArr.length; i++) {
                mkDirProArr.push(fsPro.mkdir(mkDirArr[i]));
            }
            Promise.all(mkDirProArr).then(message => {
                console.log(message);
            }).catch(e => {
                console.log(e);
            }).finally(() => {
                let cpDirProArr = [];
                for (let i = 0; i < cpDirArr.length; i++) {
                    cpDirProArr.push(fsPro.cpdir(cpDirArr[i][0], cpDirArr[i][1]));
                }
                let cpFileProArr = [];
                for (let i = 0; i < cpDirArr.length; i++) {
                    cpFileProArr.push(fsPro.cpfile(cpFileArr[i][0], cpFileArr[i][1]));
                }
                Promise.all([...cpFileProArr, ...cpDirProArr]).then(message => {
                    resolve();
                }).catch(e => {
                    reject(e);
                })
            })

        })
    }).catch((e) => {
        reject(e);
    }) */
    fsPro.readdir(path).then((message) => {
        let cpDirArr = [];
        let cpFileArr = [];
        let delDirArr = [];
        //let mkDirArr = [];
        let len = message.length;
        for (let i = 0; i < len; i++) {
            let oldPath = path + "/" + message[i];
            let stat = nodeFs.statSync(oldPath);
            if (stat.isFile()) {
                let newPath = MixlyArduino.arduinoCliPath + "/Arduino15/" + message[i];
                cpFileArr.push(fsPro.cpfile(oldPath, newPath));
            } else {
                let newPath = MixlyArduino.arduinoCliPath + "/Arduino15/packages/" + message[i];
                cpDirArr.push(fsPro.cpdir(oldPath, newPath));
                if (nodeFs.existsSync(newPath)
                    && nodeFs.statSync(newPath).isDirectory()) {
                    delDirArr.push(fsPro.deldir(newPath));
                    //mkDirArr.push(fsPro.mkdir(newPath));
                }
            }
        }
        console.log("start del dir");
        Promise.all(delDirArr).then(message => {
            console.log("del dir end");
        }).catch(e => {
            console.log("del dir err");
        }).finally(() => {
            console.log("start copy dir");
            Promise.all([...cpFileArr, ...cpDirArr]).then(message => {
                console.log("copy dir end");
                resolve();
            }).catch(e => {
                console.log("copy dir err");
                reject(e);
            })
        })
    }).catch((e) => {
        reject(e);
    })
})